import java.util.ArrayList;
import java.util.List;

/**
 * Class to represent a poker player
 * @author Kat Winter
 */
public class Player {
	
	private List<Card> hand;
	private int seat;
	
	/**
	 * Constructor initializes the player's seat number
	 * @param seat Numeric identifier for this player
	 */
	public Player(int seat) {
		hand = new ArrayList<Card>();
		this.seat = seat;
	}
	
	/**
	 * Getter for the player's hand
	 * @return Copy of the player's hand
	 */
	public List<Card> getHand() {
		List<Card> copyOfHand = new ArrayList<Card>(hand);
		return copyOfHand;
	}
	
	/**
	 * Adds a card to the player's hand
	 * @param newCard Card to be added to the player's hand
	 */
	public void addCard(Card newCard) {
		hand.add(newCard);
	}
	
	/**
	 * Getter for a single Card in the player's hand identified by index parameter
	 * but leaves the Card in the player's hand
	 * @param indexOfCard Index for the Card which should be returned
	 * @return Card at the given index
	 */
	public Card getCard(int indexOfCard) {
		return hand.get(indexOfCard);
	}
	
	/**
	 * Removes the Card at the given index from the hand and returns it
	 * @param indexOfCard Index for the Card which should be removed and returned
	 * @return Card at the given index
	 */
	public Card removeCard(int indexOfCard) {
		return hand.remove(indexOfCard);
	}
	
	/**
	 * Removes the given Card from the hand
	 * @param card Card to be removed from the hand
	 */
	public void removeCard(Card card) {
		hand.remove(card);
	}
	
	/**
	 * Getter for the player's seat number
	 * @return Int for the seat number at which this player is sitting
	 */
	public int getSeat() {
		return seat;
	}

}
